import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

const store = new Vuex.Store({
  state: {
    bags: [],
    user_info: null,
  },
  //mutations是修改store数据入口
  mutations: {
    setBags (state, payload) {
      state.bags = payload;
    },
    setAddressInfo (state, payload) {
      state.addressInfo = payload;
    },
    setUserInfo (state, payload) {
      state.user_info = payload;
    },
  },
  actions: {},
})

export default store
